package com.dmagic.cms.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.Where;

import com.dmagic.cms.common.Constants;
import com.dmagic.cms.common.entity.ModifyInfoEntity;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@Table(name = "dmagic_product")
@Where(clause = ModifyInfoEntity.ISOBSOLETE_DATE_IS_NULL)
@JsonAutoDetect
@JsonIgnoreProperties(value = { "createdBy", "createdOn", "modifiedBy", "modifiedOn", "isObsoleteDate" })
public class Product extends ModifyInfoEntity implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 215425021278758153L;

    private Long productId;

    private String productNo;

    private String productModel;

    private String productName;

    private Long productCategoryId;

    private Boolean productStatus = false;

    private Long uploadFileSetInfoId;

    private String productContent;

    private Date productDate;

    private Boolean isTop = false;

    private Long languageId;

    public Product() {
        super();
    }

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = Constants.ID_GENERATOR)
    @TableGenerator(name = Constants.ID_GENERATOR, // Generator Name which same
                                                   // with
    // generator
    table = Constants.ID_GENERATOR, // Generator Table Name
    pkColumnName = Constants.PK_COLUMNNAME, // Generator Table column Id name
    valueColumnName = Constants.VALUE_COLUMN_NAME, // Generator Table column Id
                                                   // value
    pkColumnValue = "Product", // entity Name
    allocationSize = (Constants.ID_GENERATOR_ALLLCATIONSIZE), initialValue = Constants.ID_GENERATOR_INITIALVALUE)
    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductNo() {
        return productNo;
    }

    public void setProductNo(String productNo) {
        this.productNo = productNo;
    }

    public String getProductModel() {
        return productModel;
    }

    public void setProductModel(String productModel) {
        this.productModel = productModel;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getProductCategoryId() {
        return productCategoryId;
    }

    public void setProductCategoryId(Long productCategoryId) {
        this.productCategoryId = productCategoryId;
    }

    public Boolean getProductStatus() {
        return productStatus;
    }

    public void setProductStatus(Boolean productStatus) {
        this.productStatus = productStatus;
    }

    @JsonIgnore
    public String getProductContent() {
        return productContent;
    }

    public void setProductContent(String productContent) {
        this.productContent = productContent;
    }

    public Date getProductDate() {
        return productDate;
    }

    public void setProductDate(Date productDate) {
        this.productDate = productDate;
    }

    public Boolean getIsTop() {
        return isTop;
    }

    public void setIsTop(Boolean isTop) {
        this.isTop = isTop;
    }

    public Long getLanguageId() {
        return languageId;
    }

    public void setLanguageId(Long languageId) {
        this.languageId = languageId;
    }

    public Long getUploadFileSetInfoId() {
        return uploadFileSetInfoId;
    }

    public void setUploadFileSetInfoId(Long uploadFileSetInfoId) {
        this.uploadFileSetInfoId = uploadFileSetInfoId;
    }

}
